]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
screenShield: Stop using custom transition
authorFlorian Müllner <fmuellner@gnome.org>
Fri, 26 Jul 2019 00:38:49 +0000 (02:38 +0200)
committerFlorian Müllner <fmuellner@gnome.org>
Tue, 6 Aug 2019 18:50:43 +0000 (20:50 +0200)
For animating the arrows on the screenshield, we currently use a custom
transition function that tweens the opacity from 0 to maxOpacity in the
first half of the animation, and from maxOpacity back to 0 in the second
half.

This doesn't easily translate to Clutter's own animation framework, so
replace the custom transition with two consecutive tweens which do.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/22

js/ui/screenShield.js

index a7c5afdafe6d053b7affbc2b57b2fa29eef3aa01..552ca4c3da589437cf8f6047bc0cd59887cad7e9 100644 (file)
@@ -5,7 +5,6 @@ const { AccountsService, Clutter, Cogl, Gio, GLib,
 const Cairo = imports.cairo;
 const Mainloop = imports.mainloop;
 const Signals = imports.signals;
-const TweenerEquations = imports.tweener.equations;
 
 const Background = imports.ui.background;
 const GnomeSession = imports.misc.gnomeSession;
@@ -736,14 +735,16 @@ var ScreenShield = class {
         for (let i = 0; i < arrows.length; i++) {
             arrows[i].opacity = 0;
             Tweener.addTween(arrows[i],
-                             { opacity: 0,
+                             { opacity: maxOpacity,
                                delay: (unitaryDelay * (N_ARROWS - (i + 1))) / 1000,
-                               time: ARROW_ANIMATION_TIME / 1000,
-                               transition(t, b, c, d) {
-                                   if (t < d / 2)
-                                       return TweenerEquations.easeOutQuad(t, 0, maxOpacity, d / 2);
-                                   else
-                                       return TweenerEquations.easeInQuad(t - d / 2, maxOpacity, -maxOpacity, d / 2);
+                               time: ARROW_ANIMATION_TIME / (2 * 1000),
+                               transition: 'easeOutQuad',
+                               onComplete: () => {
+                                   Tweener.addTween(arrors[i], {
+                                       opacity: 0,
+                                       time: ARROW_ANIMATION_TIME / (2 * 1000),
+                                       transition: 'easeInQuad'
+                                   });
                                }
                              });
         }